package cn.zhc.com.dialog;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.TextView;

/**
 * Created by zhouhongchun on 2017/9/6.
 */

public class CustomProgressDialog extends ProgressDialog {

    TextView tv_dialog;

    public CustomProgressDialog(Context context) {
        super(context);
        setProgressStyle(ProgressDialog.STYLE_SPINNER);// 设置进度条的形式为圆形转动的进度条
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    public void setDialogText(String text){
        setMessage(text);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            dismiss();
        }
        return false;
    }
}
